﻿using System;
using System.Linq;
using System.Windows;
using System.Windows.Media;

namespace BezierApproximations.ViewModels
{
    public class LineViewModel : BindableBase
    {
        private Point start;
        private Point end;
        private double thickness;
        private SolidColorBrush color;

        public LineViewModel(Point start, Point end)
            : this(start, end, 2)
        {
        }

        public LineViewModel(Point start, Point end, double thickness)
        {
            this.Start = start;
            this.End = end;
            this.Thickness = thickness;
            this.Color = new SolidColorBrush(Colors.Black);
        }

        public SolidColorBrush Color
        {
            get
            {
                return this.color;
            }
            set
            {
                if (this.color != value)
                {
                    this.color = value;
                    this.OnPropertyChanged("Color");
                }
            }
        }

        public Point Start
        {
            get
            {
                return this.start;
            }
            set
            {
                if (this.start != value)
                {
                    this.start = value;
                    this.OnPropertyChanged("Start");
                }
            }
        }

        public Point End
        {
            get
            {
                return this.end;
            }
            set
            {
                if (this.end != value)
                {
                    this.end = value;
                    this.OnPropertyChanged("End");
                }
            }
        }

        public double Thickness
        {
            get
            {
                return this.thickness;
            }
            set
            {
                if (this.thickness != value)
                {
                    this.thickness = value;
                    this.OnPropertyChanged("Thickness");
                }
            }
        }
    }
}
